package model;

import lombok.Data;

/**
 * @author： 杨浩然
 * @date： 2023-02-01 13:54
 */
@Data
public class EqualsMessage {
    boolean boo;//是否一致
    String msg;//消息内容
    int errlevel;//错误等级 1使用红色  0代表无错

    public EqualsMessage() {
        msg="";
        errlevel=0;
        boolean boo=true;
    }

    public EqualsMessage(boolean boo, String msg, int errlevel) {
        this.boo = boo;
        this.msg = msg;
        this.errlevel = errlevel;
    }

    public void addErr(String msgdata){
        boo=false;
        errlevel=1;
        msg+="  "+msgdata;
    }
    public void addWarning(String msgdata){
        boo=false;
        msg+="  "+msgdata;
    }

    public static EqualsMessage ok(){
        return new EqualsMessage(true,"  一致",0);
    }
    public static EqualsMessage err(String msg){
        return new EqualsMessage(false,"  "+msg,1);
    }
    public static EqualsMessage warning(String msg){
        return new EqualsMessage(false,"  "+msg,0);
    }



}
